
package Example;

import java_cup.runtime.Symbol;
%%
%function nextToken
%notunix
%cup
%line
%%
"=" { return new Symbol(sym.EQUALS); }
"+" { return new Symbol(sym.PLUS); }
"-" { return new Symbol(sym.MINUS); }
"*" { return new Symbol(sym.TIMES); }
"/" { return new Symbol(sym.DIV); }
"(" { return new Symbol(sym.LPAREN); }
")" { return new Symbol(sym.RPAREN); }
"==" { return new Symbol(sym.EQ); }
"<>" { return new Symbol(sym.NQ); }
"<" { return new Symbol(sym.LT); }
">" { return new Symbol(sym.GT); }
"=<" { return new Symbol(sym.LE); }
"=>" { return new Symbol(sym.GE); }
[0-9]+ { return new Symbol(sym.NUMBER, new Integer(yytext())); }
[ \t\r\n\f] { /* ignora espaco branco */ }
. { System.err.println("Illegal character: "+yytext()); }
